package com.tpc.control.jpa;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * StatusType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "status_type", catalog = "production_control")
public class StatusType implements java.io.Serializable {

	// Fields

	private String statusType;
	private String description;
	private Set<Status> statuses = new HashSet<Status>(0);

	// Constructors

	/** default constructor */
	public StatusType() {
	}

	/** minimal constructor */
	public StatusType(String statusType, String description) {
		this.statusType = statusType;
		this.description = description;
	}

	/** full constructor */
	public StatusType(String statusType, String description,
			Set<Status> statuses) {
		this.statusType = statusType;
		this.description = description;
		this.statuses = statuses;
	}

	// Property accessors
	@Id
	@Column(name = "status_type", unique = true, nullable = false, length = 20)
	public String getStatusType() {
		return this.statusType;
	}

	public void setStatusType(String statusType) {
		this.statusType = statusType;
	}

	@Column(name = "description", nullable = false, length = 50)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "statusType")
	public Set<Status> getStatuses() {
		return this.statuses;
	}

	public void setStatuses(Set<Status> statuses) {
		this.statuses = statuses;
	}

}